package mutipackage;

import java.nio.charset.Charset;

import org.apache.mina.core.session.IoSession;
import org.apache.mina.filter.codec.ProtocolCodecFactory;
import org.apache.mina.filter.codec.ProtocolDecoder;
import org.apache.mina.filter.codec.ProtocolEncoder;

public class MutiProtocalCodecFactory implements ProtocolCodecFactory {

	Charset forName ;
	public MutiProtocalCodecFactory(Charset forName) {
		this.forName = forName ;
	}

	@Override
	public ProtocolEncoder getEncoder(IoSession session) throws Exception {
		return new AsResponseEncoder(forName);
	}

	@Override
	public ProtocolDecoder getDecoder(IoSession session) throws Exception {
		return new AsResponseDecoder(forName);
	}

}
